<template>
  <div>
    <h1>{{title}}</h1>
    <hr>
    <h3 v-html="content"></h3>
  </div>
</template>

<script>
export default {
  name: 'detail',
  // props: {
    
  // },
  data () {
    return {
      //protocolsId,
      protocolId: this.$route.query.id,
      title: null,
      content: null
    }
  },
  mounted () {
    alert("paramId:" + this.protocolId)
    this.getsingledetail(this.protocolId)
  },
  methods: {
    getsingledetail (protocolId) {
      this.$http.get('posts/' + protocolId).then(response => {
        alert(JSON.stringify(response.data))
        this.title = response.data.title.rendered;
        this.content = response.data.content.rendered;  
      })
      .catch(error => {
        alert(error)
      }) 
    }
  }
}
</script>

<style scoped>

</style>
